﻿using System;
using System.Windows.Forms;
using Aspects.Unit;

namespace Aspects.Panels.Main_Panels
{
    public partial class UnitInformationPanel : Panel
    {
        public UnitInformationPanel()
        {
            InitializeComponent();
        }

        public void PopulateUnitInformation()
        {
            unitModelLabel.Text = UnitModel.GetModel();
            UnitModel.GetModelByte();
            serialNumberLabel.Text = UnitSerialNumber.GetSerialNumber();
            biosVersionLabel.Text = UnitBios.GetBiosNumber();
            osLabel.Text = OS.getOSString();
            cpuLabel.Text = UnitCpu.GetCpuInfo();

            var hdd = HddInfo.GetHddInfo();
            diskNameLabel.Text = hdd.Name;
            diskCapacityLabel.Text = hdd.Capacity;
            diskFirmwareLabel.Text = hdd.Firmware;
            memoryLabel.Text = MemoryInformation.GetTotalMemory();
            NetworkPresenceInformation.GetAdapatersPresent();
            biometricLabel.Text = BiometricInformation.IsPresent ? "Present" : "Not Present";
            var networkAdaptersPresense = NetworkPresenceInformation.GetAdapatersPresent();
            bluetoothLabel.Text = networkAdaptersPresense[0] ? "Present" : "Not Present";
            wifiLabel.Text = networkAdaptersPresense[1] ? "Present" : "Not Present";
            cellularLabel.Text = networkAdaptersPresense[2] ? "Present" : "Not Present";
        }

        public bool IsServiceTypeSelected()
        {
            return productionRadio.Checked || serviceRadio.Checked;
        }

        public string GetServiceString()
        {
            return productionRadio.Checked ? "P.png" : "S.png";
        }
    }
}
